package com.bailan.foreat.controller;


import com.bailan.foreat.entity.Address;
import com.bailan.foreat.entity.Seller;
import com.bailan.foreat.utils.SellerUtils;
import com.bailan.foreat.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @Autowired
    AddressService addressService;

    @RequestMapping("add")
    @ResponseBody
    public Integer add(Address address, HttpServletRequest request){


        Seller currentSeller = SellerUtils.getCurrentSeller(request);

        return addressService.addAddress(address);

    }

}

